<?php
/*
Plugin Name: 百度网盘
Plugin URI: https://www.beizigen.com/post/wordpress-automatically-backs-up-data-to-baidu-netdisk-plugin/
Description: 上传附件实时备份到百度网盘，支持定时备份数据库。
Version: 1.0.0
Author: 背字根
Author URI: https://www.beizigen.com/
Text Domain: baidupan
License: GPL v3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
*/

require_once('includes/Mysqldump.php');
require_once('includes/class-pcs.php');
require_once('includes/functions.php');
require_once('includes/dump.php');

require_once('includes/control-tool.php');
require_once('includes/control-setting.php');

//激活插件
register_activation_hook(__FILE__, function () {
});

//停用插件
register_deactivation_hook(__FILE__, 'baidupan_delete_cron');

//卸载插件
register_uninstall_hook(__FILE__, 'baidupan_delete_cron');

//添加菜单
function baidupan_add_menu()
{
	add_menu_page('百度网盘', '百度网盘', 'administrator', 'baidupan-tool', 'baidupan_tool_control', 'dashicons-cloud', 999);
	add_submenu_page('baidupan-tool', '百度网盘备份工具', '工具', 'administrator', 'baidupan-tool', 'baidupan_tool_control');
	add_submenu_page('baidupan-tool', '百度网盘备份设置', '设置', 'administrator', 'baidupan-setting', 'baidupan_setting_control');
}
add_action('admin_menu', 'baidupan_add_menu');
